﻿@model MovieCopiesListViewModel
        
@{
    ViewBag.Title = "MoviesCopies";
    Layout = "~/Views/Shared/WorkerLayout.cshtml";
}

@if (Model != null && Model.Copies != null && Model.Copies.Count > 0)
{
    <h2>Nośniki filmu @Model.Movie.MovieTitle</h2>
    
    <table class="list">
                <thead>
                    <tr>
                        <td>Lokalizacja</td>
                        <td>Adres</td>
                        <td>Liczba sztuk</td>
                        <td></td>
                    </tr>
                </thead>

            @foreach (KeyValuePair<Agencies, int> pair in Model.Copies)
            {
                 <tr>
                    <td>@pair.Key.AgencyName</td>
                    <td>@String.Format("{0}",pair.Key.AgencyAddress)</td>
                    <td>@pair.Value</td>
                    <td>@Html.ActionLink("Nośniki", "MovieCopiesInLocation", new { agencyId = pair.Key.AgencyID})</td>
                 </tr>
            }
    </table>
}
